package servlets;

import java.io.IOException;
import java.io.Serializable;
import java.rmi.RemoteException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import bdelegate.BdelegateWeb;

public class Test extends HttpServlet implements Serializable {

	private static final long serialVersionUID = 1L;
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    {
        doPost(request, response);
    }
	
	/**
	 * DoPost
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    {
		String accion = request.getParameter("accion");
		BdelegateWeb bd = BdelegateWeb.getInstancia();
		
		if(accion.equals("hola")) {
			
			String output = bd.hola();
			response.setContentType("text/html");  
		    response.setCharacterEncoding("UTF-8");
		    response.getWriter().write(output);
		}
    }

	
}
